package com.esri.core.internal.tasks.d;

import com.esri.core.internal.io.handler.h;
import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.io.UserCredentials;
import com.esri.core.tasks.na.ClosestFacilityResult;
import com.esri.core.tasks.na.NetworkDescription;
import java.util.HashMap;
import org.codehaus.jackson.JsonParser;

/* loaded from: classes.dex */
public class a extends com.esri.core.internal.tasks.d<ClosestFacilityResult> {
    private static final long serialVersionUID = 1;

    public a(b bVar, String str, UserCredentials userCredentials) {
        super(bVar, str, userCredentials);
    }

    public a(b bVar, String str, UserCredentials userCredentials, TaskListener<ClosestFacilityResult> taskListener) {
        super(bVar, str, userCredentials, taskListener);
    }

    public b a() throws Exception {
        HashMap hashMap = new HashMap();
        hashMap.put("f", "json");
        JsonParser jsonParser = null;
        try {
            jsonParser = h.a(this.serviceURL, hashMap, getServiceCredentials());
            return b.a(jsonParser);
        } finally {
            if (jsonParser != null) {
                jsonParser.close();
            }
        }
    }

    @Override // com.esri.core.internal.tasks.a
    /* renamed from: b */
    public ClosestFacilityResult execute() throws Exception {
        JsonParser jsonParser = null;
        try {
            jsonParser = h.a(this.serviceURL + "/solveClosestFacility", this.actionInput.generateRequestParams(), getServiceCredentials(), true);
            return ClosestFacilityResult.fromJson(jsonParser);
        } finally {
            if (jsonParser != null) {
                jsonParser.close();
            }
        }
    }

    public NetworkDescription c() throws Exception {
        HashMap hashMap = new HashMap();
        hashMap.put("f", "json");
        JsonParser jsonParser = null;
        try {
            jsonParser = h.a(this.serviceURL, hashMap, getServiceCredentials());
            return NetworkDescription.fromJson(jsonParser);
        } finally {
            if (jsonParser != null) {
                jsonParser.close();
            }
        }
    }
}
